package com.evil.application.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.evil.common.application.enums.robot.RobotSourceTypeEnum;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 应用机器人表
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@TableName(value = "evil_application_robot")
public class ApplicationRobot implements Serializable {

    /**
     * id
     */
    @TableId(value = "robot_id", type = IdType.AUTO)
    private Long robotId;

    /**
     * 企业id
     */
    @TableField(value = "enterprise_id")
    private Long enterpriseId;

    /**
     * 源类型
     *
     * @see RobotSourceTypeEnum#getId()
     */
    @TableField(value = "source_type")
    private Integer sourceType;

    /**
     * 源id
     */
    @TableField(value = "source_id")
    private Long sourceId;

    /**
     * 应用版本(0:发布版, 1:设计版)
     */
    @TableField(value = "application_version")
    private Integer applicationVersion;

    /**
     * 机器人名称
     */
    @TableField(value = "robot_name")
    private String robotName;

    /**
     * 首次触发时间类型
     */
    @TableField(value = "first_trigger_type")
    private Integer firstTriggerType;

    /**
     * 触发条件配置
     */
    @TableField(value = "trigger_setting")
    private String triggerSetting;

    /**
     * 重复周期类型
     */
    @TableField(value = "repeat_type")
    private Integer repeatType;

    /**
     * 重复周期配置
     */
    @TableField(value = "repeat_setting")
    private String repeatSetting;

    /**
     * 触发动作
     */
    @TableField(value = "trigger_type")
    private Integer triggerType;

    /**
     * 目标应用
     */
    @TableField(value = "target_application_id")
    private Long targetApplicationId;

    /**
     * 是否开启重新触发数据关联或公式(0:否, 1:是)
     */
    @TableField(value = "recalculation")
    private Integer recalculation;

    /**
     * 重新触发数据关联或公式的控件id集合
     */
    @TableField(value = "recalculation_control_ids")
    private String recalculationControlIds;

    /**
     * 机器人状态(0:关, 1:开)
     */
    @TableField(value = "robot_status")
    private Integer robotStatus;

    /**
     * 源机器人id
     */
    @TableField(value = "source_robot_id")
    private Long sourceRobotId;

    /**
     * 排序 越小越靠前
     */
    @TableField(value = "sort")
    private Integer sort;

    /**
     * 同步(0:关, 1:开)
     */
    @TableField(value = "sync")
    private Integer sync;

    /**
     * 是否已删除(0:否, 1:是)
     */
    @TableField(value = "is_deleted")
    private Integer isDeleted;

    /**
     * 创建人
     */
    @TableField(value = "creator_id")
    private Long creatorId;

    /**
     * 创建人名字
     */
    @TableField(value = "creator_name")
    private String creatorName;

    /**
     * 修改操作人
     */
    @TableField(value = "modifier_id")
    private Long modifierId;

    /**
     * 修改操作人名字
     */
    @TableField(value = "modifier_name")
    private String modifierName;

    /**
     * 创建时间
     */
    @TableField(value = "created")
    private Date created;

    /**
     * 更新时间
     */
    @TableField(value = "updated")
    private Date updated;

    @Serial
    private static final long serialVersionUID = 1L;

    public static final String COL_ROBOT_ID = "robot_id";

    public static final String COL_ENTERPRISE_ID = "enterprise_id";

    public static final String COL_SOURCE_TYPE = "source_type";

    public static final String COL_SOURCE_ID = "source_id";

    public static final String COL_APPLICATION_VERSION = "application_version";

    public static final String COL_ROBOT_NAME = "robot_name";

    public static final String COL_FIRST_TRIGGER_TYPE = "first_trigger_type";

    public static final String COL_TRIGGER_SETTING = "trigger_setting";

    public static final String COL_REPEAT_TYPE = "repeat_type";

    public static final String COL_REPEAT_SETTING = "repeat_setting";

    public static final String COL_TRIGGER_TYPE = "trigger_type";

    public static final String COL_TARGET_APPLICATION_ID = "target_application_id";

    public static final String COL_RECALCULATION = "recalculation";

    public static final String COL_RECALCULATION_CONTROL_IDS = "recalculation_control_ids";

    public static final String COL_ROBOT_STATUS = "robot_status";

    public static final String COL_SOURCE_ROBOT_ID = "source_robot_id";

    public static final String COL_SORT = "sort";

    public static final String COL_SYNC = "sync";

    public static final String COL_IS_DELETED = "is_deleted";

    public static final String COL_CREATOR_ID = "creator_id";

    public static final String COL_CREATOR_NAME = "creator_name";

    public static final String COL_MODIFIER_ID = "modifier_id";

    public static final String COL_MODIFIER_NAME = "modifier_name";

    public static final String COL_CREATED = "created";

    public static final String COL_UPDATED = "updated";
}
